import {request} from "./request";
export function getMenuList(){
    return request(
        {
            method:'get',
            url:'/menus',
        }
    )
}
export function getUserList(params){
    return request(
        {
            method:'get',
            url:'/users',
            params:params
        }
    )
}
export function postUserList(params){
    return request({
        method:'post',
        url:'/users',
        data:params
    })
}
export function putUserList(id,params){
    return request({
        method:'put',
        url:`/users/${id}`,
        data:params
    })
}
export function delUserList(id,params){
    return request({
        method:'delete',
        url:`/users/${id}`,
        data:params
    })
}
export function editUserState(uId,type){
    return request({
        method:'put',
        url:`users/${uId}/state/${type}`,
        params:{
            uId,
            type
        }
    })
}
//分配用户角色
export function editUserRoles(id,params){
    return request({
        method:'put',
        url:`users/${id}/role`,
        data:params
    })
}